package com.woniu.controller;

import com.woniu.service.SearchPaperService;
import com.woniuxy.commons.entity.QueryConditions;
import com.woniuxy.commons.entity.TestPaper;
import org.apache.catalina.LifecycleState;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.LinkedList;
import java.util.List;


/**
 * @program: bzeducation
 * @author: Xingqilin
 * @create: 2020-07-20 15:26
 * @description:试卷作业查询
 */
@RestController
@RequestMapping("/getPaper")
public class SearchPaperController {

    @Resource
    SearchPaperService searchPaperService;

    @GetMapping("/paper/{paperID}")
    public TestPaper getPaperById(@PathVariable Long paperID) {
        return searchPaperService.getPaperById(paperID);
    }

    @RequestMapping(value = "/paperName/{pName}", method = RequestMethod.GET)
    public TestPaper getPaperByName(@PathVariable String pName) {
        return searchPaperService.getPaperByName(pName);
    }

    @RequestMapping(value = "/paperList/{subject}", method = RequestMethod.GET)
    public List<TestPaper> getPaperList(@PathVariable String subject) {
        List<TestPaper> paperList = searchPaperService.getPaperList(subject);
        return paperList;
    }
}
